<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>填写</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../css/mui.css"/>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../css/heard.css"/>
    <link rel="stylesheet" type="text/css" href="../css/goods_detail.css"/>

    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/min.js"></script>
    <script type="text/javascript" src="../script/jq.min.js"></script>
    <script type="text/javascript" src="../script/vue.min.js"></script>
    <style>
        .empty {
            text-align: center;
            padding: 120px 0;
        }

        /* 头部导航样式 */
        .swiper-slide img {
            width: 100%;
        }

        body {
            background-color: #fff;
        }

    </style>
</head>
<body>
<!--顶部标题栏-->
<div class="header" id="topbar">
    <div class="left" style="margin-left: 5px;" tapmode onclick="goback()">
        <img src="../image/fhui.png" alt="" class="logoleft">
    </div>
    <div class="t">
        <span class="title">商品详情</span>
    </div>
</div>

<!--内容区-->
<div style="height: 60px;">

</div>
<div>
    <div>
        <div style="padding: 5px;">外卖信息填写：</div>
        <div style="margin: 1px 5px;"><textarea id="order_msg"
                                                placeholder="请填写所需购买的东西、购买地址、联系电话等相关信息，比如：购买烟，地址：一单元2楼，联系电话：1310000000"
                                                name="" id="" cols="30" rows="10"></textarea></div>
    </div>
</div>


<div class="common-problem">
    <div class="h">
        <div class="line"></div>
        <span class="title">
            常见问题
            </span>
    </div>


    <div class="b">
        <div class="item">
            <div class="question-box">
                <span class="spot"></span>
                <span class="question">
                    订单任何填写？
                    </span>
            </div>
            <div class="answer">在订单填写时，请填写好跑腿地址与自身地址，联系方式等相关信息。</div>
        </div>
        <div class="item">
            <div class="question-box">
                <span class="spot"></span>
                <span class="question">
                     跑腿运费如何收取？
                    </span>
            </div>
            <div class="answer">在订单填写时，费用问题请与客服人员沟通，在服务完成后，由服务人员当面收费。</div>
        </div>
    </div>
</div>


<div class="ft_nav" style="height: 40px;background: #00AAFF;color: white;font-size: 16px;" onclick="addShopCart()">
    <div class="div bug-type">提交订单</div>
</div>

</body>
<script type="text/javascript">
    var data_list = "";
    (function () {
        vm = new Vue({
            el: '#cont',
            data: {
                list: [],
                banneritem: []
            }
        });
    })();

    var deviceId = "";
    apiready = function () {
        deviceId = api.deviceId;//设备编码
    };


    var ceshiUrl = 'http://www.solearn.top/paotui/public/index.php/index/index/add_order';

    function addShopCart() { //添加到购物车
        var order_msg = $("#order_msg").val();
        if (!order_msg) {
            api.toast({
                msg: '订单信息不能为空',
                duration: 4000,
                location: 'bottom'
            });
            return;
        }
        $.ajax({
            url: ceshiUrl,
            method: 'post',
            dataType: "json",
            data: {
                order_msg: order_msg,
                type: 2,
                deviceId: deviceId
            },
            success: function (res) {
                if (res.status == 1) {
                    api.toast({
                        msg: '订单添加成功，请等待工作人员与你联系',
                        duration: 2000,
                        location: 'bottom'
                    });
                    $("#order_msg").val("");
                } else {
                    api.toast({
                        msg: res.msg,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            }
        });
    }

    function goback() {
        api.closeFrame({name: 'add_waimai_order'});
    }


</script>
</html>